home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / datatypes / clidt / misc / debug.h < prev    next >
C/C++ Source or Header  |  1996-04-07  |  1KB  |  61 lines

  1. #ifndef DEBUG_H
  2. #define DEBUG_H
  3.  
  4. /* debug.h
  5. **
  6. ** $VER: debug.h 0.1 (31.03.94)
  7. **
  8. ** by
  9. **
  10. ** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  11. **
  12. ** (C) Copyright 1994
  13. ** All Rights Reserved !
  14. **
  15. ** $HISTORY:
  16. **
  17. ** 31.03.94 : 000.001 : initial
  18. */
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. #define bug      KPrintF
  25.  
  26. #ifdef DEBUG
  27.  
  28. extern void KPrintF(char *fmt,...);
  29.  
  30. #define D(x)     x
  31. #define DB(x)   { bug(__FILE__ "(%4ld):" __FUNC__ "() :",__LINE__); \
  32.                         bug x; \
  33.                      }
  34.  
  35. #define DTL(x)  { struct TagItem *tstate = x; \
  36.                         struct TagItem *tag; \
  37.                         bug(__FILE__ "(%4ld):" __FUNC__ "() TagList :\n",__LINE__); \
  38.                         while((tag = NextTagItem(&tstate))) \
  39.                           bug("{0x%08lx,0x%08lx}\n",tag->ti_Tag,tag->ti_Data); \
  40.                      }
  41.  
  42. #define ENTERING  bug("entering " __FUNC__ "()\n")
  43. #define LEAVING   bug("leaving " __FUNC__ "()\n")
  44.  
  45. #else
  46.  
  47. #define D(x)
  48. #define DB(x)
  49. #define DTL(x)
  50. #define ENTERING
  51. #define LEAVING
  52.  
  53. #endif
  54.  
  55. #ifdef __cplusplus
  56. };
  57. #endif
  58.  
  59. #endif   /* DEBUG_H */
  60.  
  61.